package com.itheima.mapper;

import com.itheima.pojo.Emp;
import com.itheima.pojo.PageResult;
import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {

    @Insert("insert  into  student(name,no,gender,phone,id_card,is_college,address,degree,graduation_date,clazz_id,create_time,update_time) values(#{name},#{no},#{gender},#{phone},#{idCard},#{isCollege},#{address},#{degree},#{graduationDate},#{clazzId},#{createTime},#{updateTime})")

    Integer insert(Student student);


    List<Emp> list(StudentQueryParam studentQueryParam);

    void delete(List<Integer> ids);

    @Select("select  * from  student where  id=#{id}")
    Student getById(Integer id);


    void updateById(Student stu);

    int updateViolation(@Param("id") Integer id, @Param("score") Short score);

    @MapKey(value = "name")
    List<Map<String, Object>> countStudentCountData();


    @MapKey(value = "name")
    List<Map> countStudentDegreeData();

}
